using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class WeaponObj : MonoBehaviour
{
    //拥有者
    public TankBase own;

    //子弹
    public GameObject bullet;

    //发射位置
    public Transform[] shootPos;

    public void Fire()
    {
        for (var i = 0; i < shootPos.Length; i++)
        {
            GameObject bulletObj = Instantiate(bullet, shootPos[i].position, shootPos[i].rotation);
            //控制子弹的操作
            BulletObj component = bulletObj.GetComponent<BulletObj>();
            component.SetOwn(own);
        }
    }

    public void SetFather(TankBase tankBase)
    {
        own = tankBase;
    }
}